import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/get_risk_analysis_entity.dart';

GetRiskAnalysisEntity $GetRiskAnalysisEntityFromJson(Map<String, dynamic> json) {
  final GetRiskAnalysisEntity getRiskAnalysisEntity = GetRiskAnalysisEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getRiskAnalysisEntity.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    getRiskAnalysisEntity.name = name;
  }
  final int? status = jsonConvert.convert<int>(json['status']);
  if (status != null) {
    getRiskAnalysisEntity.status = status;
  }
  final dynamic children = json['children'];
  if (children != null) {
    getRiskAnalysisEntity.children = children;
  }
  final String? jsonDate = jsonConvert.convert<String>(json['json']);
  if (jsonDate != null) {
    getRiskAnalysisEntity.jsonDate = jsonDate;
  }
  final String? styleIcon = jsonConvert.convert<String>(json['styleIcon']);
  if (styleIcon != null) {
    getRiskAnalysisEntity.styleIcon = styleIcon;
  }
  final String? logoIcon = jsonConvert.convert<String>(json['logoIcon']);
  if (logoIcon != null) {
    getRiskAnalysisEntity.logoIcon = logoIcon;
  }
  return getRiskAnalysisEntity;
}

Map<String, dynamic> $GetRiskAnalysisEntityToJson(GetRiskAnalysisEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  data['status'] = entity.status;
  data['children'] = entity.children;
  data['json'] = entity.jsonDate;
  data['styleIcon'] = entity.styleIcon;
  data['logoIcon'] = entity.logoIcon;
  return data;
}

extension GetRiskAnalysisEntityExtension on GetRiskAnalysisEntity {
  GetRiskAnalysisEntity copyWith({
    String? id,
    String? name,
    int? status,
    dynamic children,
    String? jsonDate,
    String? styleIcon,
    String? logoIcon,
  }) {
    return GetRiskAnalysisEntity()
      ..id = id ?? this.id
      ..name = name ?? this.name
      ..status = status ?? this.status
      ..children = children ?? this.children
      ..jsonDate = jsonDate ?? this.jsonDate
      ..styleIcon = styleIcon ?? this.styleIcon
      ..logoIcon = logoIcon ?? this.logoIcon;
  }
}
